<?php
/**
 * MyBB 1.6
 * Copyright 2010 MyBB Group, All Rights Reserved
 *
 * Website: http://mybb.com
 * License: http://mybb.com/about/license
 *
 * $Id: calendar.php 5380 2011-02-21 12:04:43Z Tomm $
 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'mod.php');

require_once "./global.php";

require_once MYBB_ROOT."inc/class_parser.php";

$lang->load("scrolls");
$lang->load("mod");

add_breadcrumb($lang->nav_mod, "mod.php?tid=".$_GET['tid']);

if( isset($_GET['tid']) )
{
    if( is_numeric($_GET['tid']) )
    {
	$query = $db->query('
	SELECT
	    '.TABLE_PREFIX.'users.uid,
	    '.TABLE_PREFIX.'users.username,
	    '.TABLE_PREFIX.'users.usergroup,
	    '.TABLE_PREFIX.'mod.tid,
	    '.TABLE_PREFIX.'mod.version,
	    '.TABLE_PREFIX.'threads.subject,
	    '.TABLE_PREFIX.'threadprefixes.displaystyle

	FROM '.TABLE_PREFIX.'mod

	JOIN '.TABLE_PREFIX.'users
	JOIN '.TABLE_PREFIX.'threads
	JOIN '.TABLE_PREFIX.'threadprefixes

	ON
	    '.TABLE_PREFIX.'mod.tid = '.TABLE_PREFIX.'threads.tid AND
	    '.TABLE_PREFIX.'threads.uid = '.TABLE_PREFIX.'users.uid AND
	    '.TABLE_PREFIX.'threadprefixes.pid = '.TABLE_PREFIX.'threads.prefix

	WHERE '.TABLE_PREFIX.'mod.tid = '.$_GET['tid'].'
	');
	
	$array = $db->fetch_array($query);
	$formatted_name = format_name($array['username'], $array['usergroup']);
	eval("\$mod_bit = \"".$templates->get("mod_bit")."\";");
    }
}
else $mod_bit = $lang->mod_happensbefore;


eval("\$mod_page = \"".$templates->get("mod_page")."\";");
output_page($mod_page);

?>
